How to count identical elements of an array

join shbcf.ru